Skip to main content

Usage

The Usage API provides organizations with detailed, itemized records of data, voice, and SMS usage. By enabling access to usage data, the API supports businesses in monitoring consumption, optimizing resources allocation and gain valuable insights into user behaviout and usage trends.

List Subscriptions Usage Items Records

Send an HTTP GET request to 1GLOBAL to get complete list of usage records associated with an organization.

GET https://api.1global.com/enterprise/usage/items

The header must contain the URL, Request Access Token, and content-type as shown below.

curl -X GET \
https://api.1global.com/enterprise/usage
-H 'Authorization: Bearer $ACCESS_TOKEN' \
-H 'Content-Type: application/json' \

Example Response:

{
"_links": {
"self": {
"href": "https://api.1global.com/enterprise/usage/items?from-date=2024-12-01&to-date=2024-12-09&limit=50"
},
"next": {
"href": "https://api.1global.com/enterprise/usage/items?cursor=dWl0ZW1fMDFKRU5ZUTFIOUpBOFROTUtBODFDQzFEOVh8TmV4dA%3D%3D&from-date=2024-12-01&to-date=2024-12-09&limit=50"
}
},
"_embedded": {
"items": [
{
"id": "uitem_01ZENZB9KSPFP9V5CXD8DW5555",
"type": "data",
"direction": "outbound",
"quantity": 52191,
"unit": "bytes",
"charged_quantity": 52191,
"cost_type": "in_bundle",
"location_country": "US",
"from_msisdn": "19170000000",
"technology": "4G",
"roaming": false,
"processed_at": "2024-12-09T15:07:03.159907Z",
"started_at": "2024-12-09T00:00:00Z",
"ended_at": "2024-12-09T00:00:00Z",
"_links": {
"account": {
"href": "https://api.1global.com/enterprise/accounts/acc_017BEFXN3RH2D2ZFJ897800000"
},
"subscription": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01EKSYTC2G5P5WRABS5WV00000"
},
"subscriber": {
"href": "https://api.1global.com/enterprise/subscribers/sbr_01EKSYTA40P86CETYA01R00000"
},
"product": {
"href": "https://api.1global.com/enterprise/products/prd_01G1X25Q1Y3CAZQC884W100000"
}
}
},
{
"id": "uitem_0hNHJUZZ6HG3ZMQQRQA5NYJ17777",
"type": "sms",
"direction": "outbound",
"quantity": 1,
"unit": "event",
"charged_quantity": 1,
"cost_type": "in_bundle",
"location_country": "FR",
"from_msisdn": "33000900000",
"to_msisdn": "352600000000",
"technology": "CS",
"roaming": false,
"is_recorded": true,
"processed_at": "2024-12-09T15:04:27.394146Z",
"started_at": "2024-12-09T14:54:59Z",
"ended_at": "2024-12-09T14:54:59Z",
"_links": {
"account": {
"href": "https://api.1global.com/enterprise/accounts/acc_01DVTK1268RZGJVV6YBQP24444"
},
"subscription": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01F9EVYS1G1JC26SF80EXA5555"
},
"subscriber": {
"href": "https://api.1global.com/enterprise/subscribers/sbr_01F9EVYR28EB7M5MQ6XFYB6666"
},
"product": {
"href": "https://api.1global.com/enterprise/products/prd_01G1X25QPVE7QMZNDD5VRY97777"
}
}
}
]
}
}

The API displays the most recent usage records first, sorted by the started_at timestamp in descending order. By default, the API retrieves data for the last 30 days, but the time range can be customized using the from-date and to-date filters, up to the data retention period.

Apply filters to refine your search results, refer to the Query Parameters section for the full list of filters available.

note

The processed_at field represents the time at which the usage data was fully processed and made available in the system. This field may differ from the ended_at timestamp, which indicates when the usage event (e.g., a call or SMS) concluded. This difference exists because usage events must be collected and processed by the network before they can appear in the system.